//
//  RaceBoatAnnotation.m
//  Regatta Mapping
//
//  Created by Asif on 8/10/12.
//  Copyright (c) 2012 TopOfStack Software. All rights reserved.
//

#import "RaceBoatAnnotation.h"

@implementation RaceBoatAnnotation

@synthesize  latitude, longitude;
@synthesize name = _name;
@synthesize boatSubtitle = _boatSubtitle;

- (id)initWithName:(NSString*)name subtitle:(NSString*)boatSubtitle
{
    if(self == [super init])
    {
        _name = [name copy];
        _boatSubtitle = [boatSubtitle copy];
        
    }
    
    return self;
}

#pragma mark MKAnnotation Protocol methods

- (NSString *)title 
{
    if ([_name isKindOfClass:[NSNull class]]) 
        return @"Unknown charge";
    else
        return _name;
}

- (NSString *)subtitle 
{
    return _boatSubtitle;
}

-(CLLocationCoordinate2D)coordinate
{
	CLLocationCoordinate2D cord = {latitude,longitude};
	return cord;
}

- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate
{
	latitude = newCoordinate.latitude;
	longitude = newCoordinate.longitude;
}

-(void) dealloc
{
    [_name release];
    [_boatSubtitle release];
    [super dealloc];
}



@end
